
package clientapp;

import javax.microedition.lcdui.*;

/**
 *
 */
public class MainView extends Form implements CommandListener {
    
    private ControllerMIDlet midlet;
    
    
    
    /**
     * constructor
     */
    public MainView(ControllerMIDlet midlet) {
        super("WIINF");
        this.midlet = midlet;

        
        try {
            // Set up this form to listen to command events
            setCommandListener(this);

           this.append("Welkom!"  + "\n\n" + "Druk op 'uitlezen' om informatie op te vragen over de opleidingen!");
           
            
            addCommand(new Command("Uitlezen", Command.OK, 2));
            // Add the Exit command
            addCommand(new Command("Exit", Command.EXIT, 1));
        } catch(Exception e) {
            e.printStackTrace();
        }
    }
    
    /**
     * Called when user action should be handled
     */
    public void commandAction(Command command, Displayable displayable) {
         if (command.getCommandType() == Command.EXIT) {
            midlet.destroyApp(true);
        } switch (command.getPriority()) {
            case 2: midlet.setSelectView();
                midlet.getSelectView();
            break;
            
        }
    }
    

  
    
}
